package com.nuoniu.sibanyun.mapper.erp.in;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.erp.in.InUnitGroup;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 计量单位分组 Mapper 接口
 * </p>
 *
 * @author baiqiang
 * @since 2020-09-25
 */
public interface InUnitGroupMapper extends BaseMapper<InUnitGroup> {

    @Select("select * from scb_unit_group where company_id=#{companyId} and account_id=#{accountId}")
    List<InUnitGroup> getUnitGroupList(Integer companyId, Integer accountId);

    @Select("select * from scb_unit_group where company_id=#{companyId} and name=#{unitGroupName}")
    InUnitGroup getByName(String unitGroupName, Integer companyId);

    @Select("select * from scb_unit_group where company_id=#{companyId} and code=#{code}")
    InUnitGroup getByCode(String code, Integer companyId);
}
